#ifndef SHT30_H
#define SHT30_H

#include "main.h" // 根据你的具体STM32型号调整

#define SHT30_I2C_ADDRESS (0x44 << 1) // SHT30 I2C地址

typedef struct {
    I2C_HandleTypeDef *hi2c;
} SHT30_HandleTypeDef;

HAL_StatusTypeDef SHT30_Init(SHT30_HandleTypeDef *sht30, I2C_HandleTypeDef *hi2c);
HAL_StatusTypeDef SHT30_WriteCommand(SHT30_HandleTypeDef *sht30, uint16_t command);
HAL_StatusTypeDef SHT30_ReadData(SHT30_HandleTypeDef *sht30, uint8_t *data, uint8_t length);
void SHT30_GetTempAndHumidity(SHT30_HandleTypeDef *sht30, float *temperature, float *humidity);

#endif // SHT30_H
